<div class="products index">
<h2><?php __('Empresas');?></h2>
<p>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Agregar Empresas', true), array('action'=>'add')); ?></li>
		<li><?php echo $html->link(__('Ver Categorias', true), array('controller'=> 'categories', 'action'=>'index')); ?> </li>
		<li><?php echo $html->link(__('Nueva Categoria', true), array('controller'=> 'categories', 'action'=>'add')); ?> </li>
	</ul>
</div>

<?php
echo $paginator->counter(array(
'format' => __('Pagina %page% de %pages%, mostrando %current% registros de %count% total, empezando en registro %start%, terminando  %end%', true)
));
?>
<table cellpadding="0" cellspacing="0">
<tr>
	<th><?php echo $paginator->sort('imagen');?></th>
    <th>Categoria</th>
	<th><?php echo $paginator->sort('nombre_empresa');?></th>
	<th><?php echo $paginator->sort('Fecha de creacion','created');?></th>
	<th class="actions"><?php __('Acciones');?></th>
</tr>
<?php
$i = 0;
foreach ($products as $product):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $html->image( 'empresas/'.ife($product['Product']['imagen']=="",'no-disponible-thumb.jpg',$product['Product']['imagen'])); ?>
		</td>
        <td>
			<?php echo $product['Category']['name']?>
		</td>
		<td>
			<?php echo $product['Product']['nombre_empresa']; ?>
		</td>
		<td>
			<?php echo $time->niceShort($product['Product']['created']); ?>
		</td>
		<td class="actions">
			<?php echo $html->link(__('Ver', true), array('action'=>'view', $product['Product']['id'])); ?>
			<?php echo $html->link(__('Modificar', true), array('action'=>'edit', $product['Product']['id'])); ?>
			<?php echo $html->link(__('Eliminar', true), array('action'=>'delete', $product['Product']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $product['Product']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
	<?php echo $paginator->prev('<< '.__('anterior', true), array(), null, array('class'=>'disabled'));?>
 | 	<?php echo $paginator->numbers();?>
	<?php echo $paginator->next(__('siguiente', true).' >>', array(), null, array('class'=>'disabled'));?>
</div>

